aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/thread/[id]/+page.server.ts
blob: 931e9cb807c1cc208c00022ae4fa17cdee628c80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { get } from "$lib/utils";
import { error } from "@sveltejs/kit";

export async function load({ params }) {
	try {
		const thread = await get(`/thread/${params.id}`);
		return { thread };
	} catch (e) {
		console.log(e);
		error(500, { message: "Failed to get thread" });
	}
}